# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-memoize
pkgver=1.1_git20200103
_gitrev=51b075935ca7070f62fae1d69fe0ff7d8fa56fdd
pkgrel=0
_pkgreal=memoize
pkgdesc="Elisp memoization functions"
url="https://github.com/skeeto/emacs-memoize"
arch="noarch"
license="Unlicense"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/skeeto/emacs-memoize/archive/$_gitrev/emacs-memoize-$_gitrev.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . \
		-l memoize-test -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 memoize.el memoize.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
c3d40fa6c58d81a2d68dc22adb05ac3f1aa737099467705a64abf2ac98c2fa86b26552a6ccc61697802864ad2cd8d422715620e29d30ce50cf976b2f029930ae  emacs-memoize-51b075935ca7070f62fae1d69fe0ff7d8fa56fdd.tar.gz
"
